home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / May 96 / FW_CFrame AdjustCursor < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  5.1 KB  |  [TEXT/ttxt]

  1. Subject:     FW_CFrame::AdjustCursor
  2. Sent:        5/17/96 7:13 PM
  3. Received:    5/22/96 8:31 AM
  4. From:        Hutchings Software Development, hsd@earthlink.net
  5. Reply-To:    ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. Nice meeting many on the ODF team this week at WWDC. I hope you're all
  9. using Cyberdog at this point.
  10.  
  11. Symptom:
  12.     ODF Table sometimes has a delayed response to mouse clicks while in
  13.     "Edit" mode.
  14.  
  15. Problem:
  16.     CTableFrame::AdjustCursor is taking a long time (i.e. >10 ticks) to
  17. run.
  18.  
  19. Here is a replacement AdjustCursor method for CTableFrame. My changes
  20. are in blue. It causes a beep when the elapsed time of the inherited
  21. call and the selection of the cursor take more than 10 ticks. You'll
  22. get a few beeps when you run either the debug or release build.
  23.  
  24.  
  25.  
  26. FW_Boolean CTableFrame::AdjustCursor(Environment* ev, ODFacet*
  27. odFacet, const FW_CPoint& where)
  28. {
  29.     FW_Boolean cursorAdjusted = FALSE;
  30.         
  31.     //     I don't want the Open Hand Cursor if I have the grid hidden
  32. because I am not supposed to
  33.     //    be able to move anything
  34.     
  35.     unsigned long ticks = TickCount();
  36.     
  37.     if (fGridShown)
  38.         cursorAdjusted = FW_CEmbeddingFrame::AdjustCursor(ev, odFacet,
  39. where);
  40.     
  41.     if (!cursorAdjusted && fGridShown)
  42.     {
  43.         CCell cell;
  44.         ETableLoc tl = HitTest(ev, where, cell);
  45.             
  46.         cursorAdjusted = TRUE;
  47.         
  48.         if (tl == kTLCell || tl == kTLNone)
  49.             FW_gArrowCursor.Select();
  50.         else if (tl == kTLLeftBorder || tl == kTLRightBorder)
  51.             FW_gSizeWECursor.Select();
  52.         else if (tl == kTLTopBorder || tl == kTLBottomBorder)
  53.             FW_gSizeNSCursor.Select();
  54.         else 
  55.             FW_gSizeNWSECursor.Select();
  56.     }
  57.     
  58.     if ((TickCount() - ticks) > 10)
  59.     {
  60.         FW_Beep();
  61.     }
  62.     
  63.     return cursorAdjusted;
  64. }
  65.  
  66.  
  67. I haven't tracked this behavior down any further...
  68.  
  69. Brad
  70.  
  71.  
  72.  
  73.  
  74. Richard B. "Brad" Hutchings
  75. General Partner,
  76. Hutchings Software Development
  77.  
  78. hsd@earthlink.net
  79.  
  80.  
  81. <SMALLER><X-FONTSIZE><PARAM>10</PARAM><X-FONTNAME><PARAM>Geneva</PARAM>Nice meeting many on the ODF team this week at WWDC. I hope you're all
  82. using Cyberdog at this point.
  83.  
  84.  
  85. </X-FONTNAME></X-FONTSIZE></SMALLER><BOLD><SMALLER><X-FONTSIZE><PARAM>10</PARAM><X-FONTNAME><PARAM>Geneva</PARAM>Symptom:</X-FONTNAME></X-FONTSIZE></SMALLER></BOLD><SMALLER><X-FONTSIZE><PARAM>10</PARAM><X-FONTNAME><PARAM>Geneva</PARAM>
  86.  
  87.     ODF Table sometimes has a delayed response to mouse clicks while in
  88.  
  89.     "Edit" mode.
  90.  
  91.  
  92. </X-FONTNAME></X-FONTSIZE></SMALLER><BOLD><SMALLER><X-FONTSIZE><PARAM>10</PARAM><X-FONTNAME><PARAM>Geneva</PARAM>Problem:</X-FONTNAME></X-FONTSIZE></SMALLER></BOLD><SMALLER><X-FONTSIZE><PARAM>10</PARAM><X-FONTNAME><PARAM>Geneva</PARAM>
  93.  
  94.     CTableFrame::AdjustCursor is taking a long time (i.e. >10 ticks) to
  95. run.
  96.  
  97.  
  98. Here is a replacement AdjustCursor method for CTableFrame. My changes
  99. are in </X-FONTNAME></X-FONTSIZE></SMALLER><X-COLOR><PARAM>RED=0;GREEN=9830;BLUE=61603</PARAM><SMALLER><X-FONTSIZE><PARAM>10</PARAM><X-FONTNAME><PARAM>Geneva</PARAM>blue</X-FONTNAME></X-FONTSIZE></SMALLER></X-COLOR><SMALLER><X-FONTSIZE><PARAM>10</PARAM><X-FONTNAME><PARAM>Geneva</PARAM>. It causes a beep when the elapsed time of the inherited call
  100. and the selection of the cursor take more than 10 ticks. You'll get a
  101. few beeps when you run either the debug or release build.
  102.  
  103. </X-FONTNAME></X-FONTSIZE></SMALLER><SMALLER><SMALLER><X-FONTSIZE><PARAM>9</PARAM><X-FONTNAME><PARAM>MPW</PARAM>
  104.  
  105.  
  106.  
  107. FW_Boolean CTableFrame::AdjustCursor(Environment* ev, ODFacet*
  108. odFacet, const FW_CPoint& where)
  109.  
  110. {
  111.  
  112.     FW_Boolean cursorAdjusted = FALSE;
  113.  
  114.         
  115.  
  116.     //     I don't want the Open Hand Cursor if I have the grid hidden
  117. because I am not supposed to
  118.  
  119.     //    be able to move anything
  120.  
  121.     
  122.  
  123. </X-FONTNAME></X-FONTSIZE></SMALLER></SMALLER><X-COLOR><PARAM>RED=0;GREEN=9830;BLUE=61603</PARAM><SMALLER><SMALLER><X-FONTSIZE><PARAM>9</PARAM><X-FONTNAME><PARAM>MPW</PARAM>    unsigned long ticks =
  124. TickCount();
  125.  
  126. </X-FONTNAME></X-FONTSIZE></SMALLER></SMALLER></X-COLOR><SMALLER><SMALLER><X-FONTSIZE><PARAM>9</PARAM><X-FONTNAME><PARAM>MPW</PARAM>    
  127.  
  128.     if (fGridShown)
  129.  
  130.         cursorAdjusted = FW_CEmbeddingFrame::AdjustCursor(ev, odFacet,
  131. where);
  132.  
  133.     
  134.  
  135.     if (!cursorAdjusted && fGridShown)
  136.  
  137.     {
  138.  
  139.         CCell cell;
  140.  
  141.         ETableLoc tl = HitTest(ev, where, cell);
  142.  
  143.             
  144.  
  145.         cursorAdjusted = TRUE;
  146.  
  147.         
  148.  
  149.         if (tl == kTLCell || tl == kTLNone)
  150.  
  151.             FW_gArrowCursor.Select();
  152.  
  153.         else if (tl == kTLLeftBorder || tl == kTLRightBorder)
  154.  
  155.             FW_gSizeWECursor.Select();
  156.  
  157.         else if (tl == kTLTopBorder || tl == kTLBottomBorder)
  158.  
  159.             FW_gSizeNSCursor.Select();
  160.  
  161.         else 
  162.  
  163.             FW_gSizeNWSECursor.Select();
  164.  
  165.     }
  166.  
  167.     
  168.  
  169. </X-FONTNAME></X-FONTSIZE></SMALLER></SMALLER><X-COLOR><PARAM>RED=0;GREEN=9830;BLUE=61603</PARAM><SMALLER><SMALLER><X-FONTSIZE><PARAM>9</PARAM><X-FONTNAME><PARAM>MPW</PARAM>    if ((TickCount() - ticks) > 10)
  170.  
  171.     {
  172.  
  173.         FW_Beep();
  174.  
  175.     }
  176.  
  177. </X-FONTNAME></X-FONTSIZE></SMALLER></SMALLER></X-COLOR><SMALLER><SMALLER><X-FONTSIZE><PARAM>9</PARAM><X-FONTNAME><PARAM>MPW</PARAM>    
  178.  
  179.     return cursorAdjusted;
  180.  
  181. }
  182.  
  183.  
  184. </X-FONTNAME></X-FONTSIZE></SMALLER></SMALLER><SMALLER><X-FONTSIZE><PARAM>10</PARAM><X-FONTNAME><PARAM>Geneva</PARAM>
  185.  
  186. I haven't tracked this behavior down any further...
  187.  
  188.  
  189. Brad
  190.  
  191.  
  192.  
  193.  
  194.  
  195. Richard B. "Brad" Hutchings
  196.  
  197. General Partner,
  198.  
  199. Hutchings Software Development
  200.  
  201.  
  202. hsd@earthlink.net</X-FONTNAME></X-FONTSIZE></SMALLER>
  203.